﻿using Microsoft.AspNetCore.Mvc;
using studentSubsidy.Entity;
using studentSubsidy.Service;

namespace studentSubsidy.Controllers
{
    [ApiController]
    [Route("api/adminSigned/[Action]")]
    public class AdminSignedController: Controller
    {
        private AdminSignedService _adminSignedService = new AdminSignedService();
        
        [HttpGet(Name = "getSignedList")]
        public Result GetSignedList([FromQuery] string role)
        {
            return _adminSignedService.getSignedList(role);
        }
        
        [HttpGet(Name = "getHasSignedList")]
        public Result GetHasSignedList([FromQuery] string role)
        {
            return _adminSignedService.getHasSignedList(role);
        }
        
        [HttpGet(Name = "getSignedInfo")]
        public Result GetSignedInfo([FromQuery] int applyId)
        {
            return _adminSignedService.getSignedInfo(applyId);
        }
        
        [HttpPost(Name = "deleteSignedFile")]
        public Result DeleteSignedFile([FromQuery]int type, int applyId)
        {
            return _adminSignedService.deleteSignedFile(applyId,type);
        }
        [HttpPost(Name = "rejectSigned")]
        public Result RejectSigned([FromQuery] int applyId)
        {
            return _adminSignedService.rejectSigned(applyId);
        }
        [HttpGet(Name = "getIcon")]
        public Result GetIcon([FromQuery] int applyId)
        {
            return _adminSignedService.getIcon(applyId);
        }
        
        [HttpPost(Name = "signedSuccess")]
        public Result SignedSuccess([FromQuery] int applyId)
        {
            return _adminSignedService.signedSuccess(applyId);
        }
        
        [HttpGet(Name = "isSuccess")]
        public Result isSuccess([FromQuery] int applyId)
        {
            return _adminSignedService.isSuccess(applyId);
        }
        
        [HttpGet(Name = "getSignedNeedCheckList")]
        public Result GetSignedNeedCheckList([FromQuery] string role)
        {
            return _adminSignedService.getSignedNeedCheckList(role);
        }
    }
}